<template>
  <div id="app">
    <router-view />
    <!-- 全局头部 -->
    <!-- <head-main /> -->
  </div>
</template>

<script>
// import headMain from './components/headMain.vue'
export default {
  // components: { headMain },
  name: 'App',
  methods: {
    disableDeveloperTools() {
      // 禁用控制台
      const disableConsole = () => {
        console.log = () => {}
        console.warn = () => {}
        console.error = () => {}
      }

      // 禁用F12快捷键
      const disableF12 = (event) => {
        if (event.keyCode === 123) {
          event.preventDefault()
        }
      }

      // 禁用右键菜单
      const disableRightClick = (event) => {
        if (event.button === 2) {
          event.preventDefault()
        }
      }

      // 添加事件监听器
      document.addEventListener('keydown', disableF12)
      document.addEventListener('contextmenu', disableRightClick)

      // 确保在窗口关闭时移除事件监听器
      window.addEventListener('beforeunload', () => {
        document.removeEventListener('keydown', disableF12)
        document.removeEventListener('contextmenu', disableRightClick)
      })

      // 在页面加载时调用禁用控制台的函数
      disableConsole()
    }
  },
  mounted() {
    // this.disableDeveloperTools()
    // 禁用方法
  }
}
</script>

<style>
#app {
  -moz-transform-origin: 0 0;
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  overflow: hidden;
}
</style>
